<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<div class="t_bar">
	<span class="color_red">*</span>发展思路、目标和任务（1200字）
</div>
<table class="t_css" id="table_08" style="text-align: center;word-break: break-word">
	<tr>

		<td colspan="4">
            <textarea name="proposal/brief8"
					  class="input_textarea required maxlength:1200"
					  style="resize: none; width: 98%; height: 200px" label="发展思路、目标和任务"><x:out
					select="$xmlData/data/proposal/brief8" /></textarea>
			<input type="hidden" name="proposal/brief8_hidden"
				   value="<x:out select="$xmlData/data/proposal/brief8_hidden" />" />
		</td>
	</tr>
</table>




<script>
	$('#status1_funding,#status2_funding,#status3_funding').change(function() {
		getTotalCount("", "status1_funding,status2_funding,status3_funding",
				"total_funding", true);
	});

	function setTotalFunding(){
		var totalFunding = 0;
		$("#eq_table4 tr:gt(1)").each(function() {
			var funding = $(this).find("td:eq(5) input").val()||0;
			totalFunding += parseFloat(funding);
		});
		$("#subport_total_funding").val(parseFloat(totalFunding).toFixed(2));
	}
	/**
	 ----------------------by zk
	 参数prefix：公共的id开头
	 参数count：需要加的数的id结尾     以,分割
	 参数total：总数id结尾
	 参数isDeciaml：是否为小数 默认为false
	 */
	function getTotalCount(prefix, count, total, isDecimal) {
		var defaultIsDecimal = false;//默认为整数
		if (isDecimal == null) {
			isDecimal = defaultIsDecimal;
		}
		var numStr = count.split(',');
		var totalCount = 0;//总数
		if (!isDecimal) {
			for ( var int = 0; int < numStr.length; int++) {
				var num = $('#' + prefix + numStr[int]).val();
				if (!$.isNumeric(num))
					num = "0";
				totalCount += parseInt(num);
			}
		} else {
			for ( var int = 0; int < numStr.length; int++) {
				var num = $('#' + prefix + numStr[int]).val();
				if (!$.isNumeric(num))
					num = "0";
				totalCount += parseFloat(num);
			}
			totalCount = ((totalCount / 100) * 100).toFixed(2);
		}
		$('#' + prefix + total).val(totalCount);
	}

	function initControlValue(objId) {

		var name = "";
		var obj = $("#" + objId);
		if (obj.is("select")) {
			name = obj.attr("name");
			obj.parent().children("input[name$='" + name + "_value'][type='hidden']").val(
					$("#" + objId).find("option:selected").val());
			$("#" + objId).parent().children("input[name$='" + name + "_name']").val(
					$("#" + objId).find("option:selected").text());
		}

		else if (obj.is(":radio")) {
			name = obj.attr("name");
			if (obj.is(":checked")) {//如果被选中
				//alert($("#"+objId).val());
				obj.parents("table").find("input[name$='" + name + "_value'][type='hidden']").val(
						$("#" + objId).val());
				$("#" + objId).parent().children("input[name$='" + name + "_name']").val(
						$("#" + objId).next().text());
			} else {

				obj.parents("table").find("input[name$='" + name + "_value'][type='hidden']").val(
						"");
			}
		} else if (obj.is(":checkbox")) {
			name = obj.attr("name");
			if (obj.is(":checked"))//如果被选中
				obj.parent().find("input[name$='" + name + "_value'][type='hidden']").val(
						$("#" + objId).val());
			else
				obj.parent().find("input[name$='" + name + "_value'][type='hidden']").val("");
		} else {
			name = obj.attr("id");
			obj.parents("td").find("input[name$='" + name + "_name'][type='hidden']")
					.val(obj.val());
			obj.parents("td").find("input[name$='" + name + "_code'][type='hidden']").val(
					$("#" + objId + "_hideId").val());
		}
	}
</script>
